using DxfLib;
using System.IO;
using Xunit;

namespace TestProject1
{
    public class UnitTest1
    {
        [Fact]
        public void TestRemoveOk()
        {
            Assert.Equal("a", DxfUtils.RemoveOk("aok"));
            Assert.Equal("a", DxfUtils.RemoveOk("a Ok"));
            Assert.Equal("a", DxfUtils.RemoveOk("a  OK "));
            Assert.Equal("a", DxfUtils.RemoveOk("a ok "));
            Assert.Equal("a1", DxfUtils.RemoveOk("a ok 1"));
            Assert.Equal("1", DxfUtils.RemoveOk("ok 1"));
        }

        [Fact]
        public void TestAreSameIgnoreOk()
        {
            Assert.True(DxfUtils.AreSameIgnoreOk("a", "aok"));
            Assert.True(DxfUtils.AreSameIgnoreOk("aOk", "aok"));
            Assert.True(DxfUtils.AreSameIgnoreOk("a OK ", "a"));
        }

        [Fact]
        public void TestGetFolderName()
        {
            Assert.Equal(@"b",Path.GetFileName(@"C:\\a\\b"));
            
        }

        [Fact]
        public void TestEnumerateFileSystemEntries()
        {
            foreach(string entry in  Directory.EnumerateFileSystemEntries(@"D:/G/dxf-ok/test"))
            {
                System.Console.WriteLine(entry);
            }

        }
    }
}